import React from 'react'


export default function ToDoMain(props) {
    const { todo,useChangeIsCheckedById} = props
    return (
        <ul className="todo-main">
            {
                todo.map((item) => {
                    return (
                        <li key={item.id}>
                            <label>
                                <input onChange={()=>{useChangeIsCheckedById(item.id)}} checked={item.isChecked} type="checkbox" />
                                <span>{item.title}</span>
                            </label>
                            <button className="btn btn-danger" style={{ display: "none" }}>删除</button>
                        </li>
                    )
                })
            }
        </ul>
    )
}
